Integrand size = 29, antiderivative size = 117 \[ \int \cot (c+d x) (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\left (3 a^2 A b-A b^3+a^3 B-3 a b^2 B\right ) x-\frac {b \left (3 a A b+3 a^2 B-b^2 B\right ) \log (\cos (c+d x))}{d}+\frac {a^3 A \log (\sin (c+d x))}{d}+\frac {b^2 (A b+2 a B) \tan (c+d x)}{d}+\frac {b B (a+b \tan (c+d x))^2}{2 d} \]
[Out]
Time = 0.39 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {3688, 3718, 3705, 3556} \[ \int \cot (c+d x) (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\frac {a^3 A \log (\sin (c+d x))}{d}-\frac {b \left (3 a^2 B+3 a A b-b^2 B\right ) \log (\cos (c+d x))}{d}+x \left (a^3 B+3 a^2 A b-3 a b^2 B-A b^3\right )+\frac {b^2 (2 a B+A b) \tan (c+d x)}{d}+\frac {b B (a+b \tan (c+d x))^2}{2 d} \]
[In]
[Out]
Rule 3556
Rule 3688
Rule 3705
Rule 3718
Rubi steps \begin{align*} \text {integral}& = \frac {b B (a+b \tan (c+d x))^2}{2 d}+\frac {1}{2} \int \cot (c+d x) (a+b \tan (c+d x)) \left (2 a^2 A+2 \left (2 a A b+a^2 B-b^2 B\right ) \tan (c+d x)+2 b (A b+2 a B) \tan ^2(c+d x)\right ) \, dx \\ & = \frac {b^2 (A b+2 a B) \tan (c+d x)}{d}+\frac {b B (a+b \tan (c+d x))^2}{2 d}-\frac {1}{2} \int \cot (c+d x) \left (-2 a^3 A-2 \left (3 a^2 A b-A b^3+a^3 B-3 a b^2 B\right ) \tan (c+d x)-2 b \left (3 a A b+3 a^2 B-b^2 B\right ) \tan ^2(c+d x)\right ) \, dx \\ & = \left (3 a^2 A b-A b^3+a^3 B-3 a b^2 B\right ) x+\frac {b^2 (A b+2 a B) \tan (c+d x)}{d}+\frac {b B (a+b \tan (c+d x))^2}{2 d}+\left (a^3 A\right ) \int \cot (c+d x) \, dx+\left (b \left (3 a A b+3 a^2 B-b^2 B\right )\right ) \int \tan (c+d x) \, dx \\ & = \left (3 a^2 A b-A b^3+a^3 B-3 a b^2 B\right ) x-\frac {b \left (3 a A b+3 a^2 B-b^2 B\right ) \log (\cos (c+d x))}{d}+\frac {a^3 A \log (\sin (c+d x))}{d}+\frac {b^2 (A b+2 a B) \tan (c+d x)}{d}+\frac {b B (a+b \tan (c+d x))^2}{2 d} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.63 (sec) , antiderivative size = 115, normalized size of antiderivative = 0.98 \[ \int \cot (c+d x) (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\frac {-(a+i b)^3 (A+i B) \log (i-\tan (c+d x))+2 a^3 A \log (\tan (c+d x))-(a-i b)^3 (A-i B) \log (i+\tan (c+d x))+2 b^2 (A b+2 a B) \tan (c+d x)+b B (a+b \tan (c+d x))^2}{2 d} \]
[In]
[Out]
Time = 0.21 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.03
method | result | size |
parallelrisch | \(\frac {\left (-A \,a^{3}+3 A a \,b^{2}+3 B \,a^{2} b -B \,b^{3}\right ) \ln \left (\sec ^{2}\left (d x +c \right )\right )+2 A \,a^{3} \ln \left (\tan \left (d x +c \right )\right )+B \,b^{3} \left (\tan ^{2}\left (d x +c \right )\right )+\left (2 A \,b^{3}+6 B a \,b^{2}\right ) \tan \left (d x +c \right )+6 \left (A \,a^{2} b -\frac {1}{3} A \,b^{3}+\frac {1}{3} B \,a^{3}-B a \,b^{2}\right ) d x}{2 d}\) | \(121\) |
norman | \(\left (3 A \,a^{2} b -A \,b^{3}+B \,a^{3}-3 B a \,b^{2}\right ) x +\frac {b^{2} \left (A b +3 B a \right ) \tan \left (d x +c \right )}{d}+\frac {B \,b^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {A \,a^{3} \ln \left (\tan \left (d x +c \right )\right )}{d}-\frac {\left (A \,a^{3}-3 A a \,b^{2}-3 B \,a^{2} b +B \,b^{3}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) | \(124\) |
derivativedivides | \(\frac {\frac {B \,b^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{2}+A \,b^{3} \tan \left (d x +c \right )+3 B a \,b^{2} \tan \left (d x +c \right )+\frac {\left (-A \,a^{3}+3 A a \,b^{2}+3 B \,a^{2} b -B \,b^{3}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (3 A \,a^{2} b -A \,b^{3}+B \,a^{3}-3 B a \,b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )+A \,a^{3} \ln \left (\tan \left (d x +c \right )\right )}{d}\) | \(130\) |
default | \(\frac {\frac {B \,b^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{2}+A \,b^{3} \tan \left (d x +c \right )+3 B a \,b^{2} \tan \left (d x +c \right )+\frac {\left (-A \,a^{3}+3 A a \,b^{2}+3 B \,a^{2} b -B \,b^{3}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (3 A \,a^{2} b -A \,b^{3}+B \,a^{3}-3 B a \,b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )+A \,a^{3} \ln \left (\tan \left (d x +c \right )\right )}{d}\) | \(130\) |
risch | \(\frac {6 i B \,a^{2} b c}{d}+3 i B \,a^{2} b x +\frac {2 i b^{2} \left (-i B b \,{\mathrm e}^{2 i \left (d x +c \right )}+A b \,{\mathrm e}^{2 i \left (d x +c \right )}+3 B a \,{\mathrm e}^{2 i \left (d x +c \right )}+A b +3 B a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {2 i B \,b^{3} c}{d}+3 A \,a^{2} b x -A \,b^{3} x +B \,a^{3} x -3 B a \,b^{2} x -i A \,a^{3} x +3 i A a \,b^{2} x -i B \,b^{3} x +\frac {6 i A a \,b^{2} c}{d}-\frac {2 i a^{3} A c}{d}-\frac {3 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) A a \,b^{2}}{d}-\frac {3 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) B \,a^{2} b}{d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) B \,b^{3}}{d}+\frac {A \,a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}\) | \(264\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.14 \[ \int \cot (c+d x) (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\frac {B b^{3} \tan \left (d x + c\right )^{2} + A a^{3} \log \left (\frac {\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) + 2 \, {\left (B a^{3} + 3 \, A a^{2} b - 3 \, B a b^{2} - A b^{3}\right )} d x - {\left (3 \, B a^{2} b + 3 \, A a b^{2} - B b^{3}\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 2 \, {\left (3 \, B a b^{2} + A b^{3}\right )} \tan \left (d x + c\right )}{2 \, d} \]
[In]
[Out]
Time = 0.46 (sec) , antiderivative size = 204, normalized size of antiderivative = 1.74 \[ \int \cot (c+d x) (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\begin {cases} - \frac {A a^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {A a^{3} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} + 3 A a^{2} b x + \frac {3 A a b^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - A b^{3} x + \frac {A b^{3} \tan {\left (c + d x \right )}}{d} + B a^{3} x + \frac {3 B a^{2} b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - 3 B a b^{2} x + \frac {3 B a b^{2} \tan {\left (c + d x \right )}}{d} - \frac {B b^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {B b^{3} \tan ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (A + B \tan {\left (c \right )}\right ) \left (a + b \tan {\left (c \right )}\right )^{3} \cot {\left (c \right )} & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.37 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.06 \[ \int \cot (c+d x) (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\frac {B b^{3} \tan \left (d x + c\right )^{2} + 2 \, A a^{3} \log \left (\tan \left (d x + c\right )\right ) + 2 \, {\left (B a^{3} + 3 \, A a^{2} b - 3 \, B a b^{2} - A b^{3}\right )} {\left (d x + c\right )} - {\left (A a^{3} - 3 \, B a^{2} b - 3 \, A a b^{2} + B b^{3}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 2 \, {\left (3 \, B a b^{2} + A b^{3}\right )} \tan \left (d x + c\right )}{2 \, d} \]
[In]
[Out]
none
Time = 1.13 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.10 \[ \int \cot (c+d x) (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\frac {B b^{3} \tan \left (d x + c\right )^{2} + 2 \, A a^{3} \log \left ({\left | \tan \left (d x + c\right ) \right |}\right ) + 6 \, B a b^{2} \tan \left (d x + c\right ) + 2 \, A b^{3} \tan \left (d x + c\right ) + 2 \, {\left (B a^{3} + 3 \, A a^{2} b - 3 \, B a b^{2} - A b^{3}\right )} {\left (d x + c\right )} - {\left (A a^{3} - 3 \, B a^{2} b - 3 \, A a b^{2} + B b^{3}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \]
[In]
[Out]
Time = 8.48 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.01 \[ \int \cot (c+d x) (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (A\,b^3+3\,B\,a\,b^2\right )}{d}+\frac {A\,a^3\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{d}+\frac {B\,b^3\,{\mathrm {tan}\left (c+d\,x\right )}^2}{2\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (A-B\,1{}\mathrm {i}\right )\,{\left (b+a\,1{}\mathrm {i}\right )}^3\,1{}\mathrm {i}}{2\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (A+B\,1{}\mathrm {i}\right )\,{\left (-b+a\,1{}\mathrm {i}\right )}^3\,1{}\mathrm {i}}{2\,d} \]
[In]
[Out]